<template>
  <laker-dialog
    ref="lakerDialog"
    :title="titleMap[mode]"
    v-model="visible"
    :width="830"
    destroy-on-close
    @closed="$emit('closed')"
  >
    <iframe :src="videourl"></iframe>
    <template #footer>
      <el-button @click="visible = false">取 消</el-button>
    </template>
  </laker-dialog>
</template>

<script>
import LakerDialog from '@/components/lakerDialog/index.vue'
export default {
  name: 'HikCameraVideo',
  components: { LakerDialog },
  emits: ['success', 'closed'],
  data() {
    return {
      mode: 'show',
      titleMap: {
        show: '查看'
      },
      visible: false,
      videourl: ''
    }
  },
  mounted() {},
  methods: {
    //显示
    open(mode = 'add') {
      this.mode = mode
      this.visible = true
      return this
    },
    //表单注入数据
    setData(data) {
      this.videourl = 'http://10.66.152.7:82/videoplay/index.html?ip=' + data.ipAddress
    }
  }
}
</script>

<style scoped>
iframe {
  border: 0;
  width: 100%;
  height: 500px;
  display: block;
}
</style>
